Page({
    data: {
      countdown: 5
    },
    onLoad() {
      let interval = setInterval(() => {
        let countdown = this.data.countdown;
        if (countdown <= 0) {
          clearInterval(interval);
          wx.navigateBack();
        } else {
          countdown--;
          this.setData({
            countdown
          });
        }
      }, 1000);
    }
  });